package dao;

import domain.Recruitment;

import java.util.List;
import java.util.Map;

/**
 * Created by aceyin on 15/6/25.
 */
public interface RecruitmentDao extends GenericDao<Recruitment, Long> {

    /**
     * 获取商家指定状态的招聘列表
     *
     * @param status
     * @return
     */
    List<Recruitment> findByStatus(long owner, String status, int offset, int pageSize);

    /**
     * 更新招聘信息的应聘人数
     *
     * @param recruitmentId
     */
    void increaseApplyQuantity(int number, long recruitmentId);

    List<Recruitment> filterByConditionFromGivenIds(List<Long> ids, Map<String, Object> condition);

    Map<String, Object> getWithDistance(long id, double longitude, double latitude);

    List<Map<String, Object>> findByConditionAndUserGeo(Map<String, Object> condition, Double userLng, Double userLat, int page);

    void updateStatus(Long recruitmentId, Map<String, Object> status);

    void updateRecruitQuantity(Long id, int recruited);
}
